package com.example.demo01.Controller.webController;

import com.alibaba.fastjson.JSON;
import com.example.demo01.utils.JSONPGUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class JsonPGController {

//    @RequestMapping("/jsonpgutil/GET/json")
//    public String getBufferJSONByLonLat(
//            @RequestParam(value = "lon") String lon,
//            @RequestParam(value = "lat") String lat
//    ){
//        System.out.println("获取json数据");
//       return JSONPGUtils.getBufferJSONByLonLat(lon,lat,"");
//    }

    @RequestMapping("/coordsarray/GET/byname")
    public String getCoordsArrayString(
            @RequestParam(value = "cityname") String cityname
    ){
        return JSON.toJSONString(JSONPGUtils.getCityBoundsArray(cityname));
    }

    @RequestMapping("/coordsarray/GET/jiaozuo")
    public String getJiaoZuoCoordsArrayString(){
        return JSON.toJSONString(JSONPGUtils.getJiaoZuoCoordsArrayString());
    }

}
